/* 
 * File:   Material.h
 * Author: gilvolpe
 *
 * Created on June 7, 2013, 8:51 PM
 */

#ifndef MATERIAL_H
#define	MATERIAL_H

#include "basicInformation.h"

class Material {
public:

    Material() {

        m_Ambient[0] = 0.2f;
        m_Ambient[1] = 0.2f;
        m_Ambient[2] = 0.2f;
        m_Ambient[3] = 0.0f;

        m_Diffuse[0] = 0.2f;
        m_Diffuse[1] = 0.2f;
        m_Diffuse[2] = 0.2f;
        m_Diffuse[3] = 0.0f;

        m_Specular[0] = 1.0f;
        m_Specular[1] = 1.0f;
        m_Specular[2] = 1.0f;
        m_Specular[3] = 1.0f;

        m_Emission[0] = 0.0f;
        m_Emission[1] = 0.0f;
        m_Emission[2] = 0.0f;
        m_Emission[3] = 1.0f;

        m_Shininess = 1.0f;
    }

    void Apply() {
        glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, m_Ambient);
        glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, m_Diffuse);
        glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, m_Specular);
        glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, m_Emission);
        glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, m_Shininess);
    }

    void setSunLight(){
        
        m_Emission[0] = 1.0f;
        m_Emission[1] = 1.0f;
        m_Emission[2] = 1.0f;
        m_Emission[3] = 1.0f;
    }
    
private:
    float m_Ambient[4];
    float m_Diffuse[4];
    float m_Specular[4];
    float m_Emission[4];
    float m_Shininess;

};

#endif	/* MATERIAL_H */

